cmake_minimum_required (VERSION 2.6)
project(GEngine)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")

find_package(GMath REQUIRED)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(GEngine_SHARED_LIB graphiclicious)
set(GEngine_STATIC_LIB graphiclicious_static)
set(GEngine_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(GEngine_SOURCES 
    ${GEngine_SOURCE_DIR}/Material.cpp 
    ${GEngine_SOURCE_DIR}/MaterialGroup.cpp 
    ${GEngine_SOURCE_DIR}/Mesh.cpp 
    ${GEngine_SOURCE_DIR}/Model.cpp
    ${GEngine_SOURCE_DIR}/Node.cpp
    ${GEngine_SOURCE_DIR}/Triangle.cpp
    ${GEngine_SOURCE_DIR}/Importer.cpp
    ${GEngine_SOURCE_DIR}/G3DMImporter.cpp
    ${GEngine_SOURCE_DIR}/BinaryStreamReader.cpp
    ${GEngine_SOURCE_DIR}/ImporterException.cpp
    ${GEngine_SOURCE_DIR}/Color4f.cpp
    )

add_library(${GEngine_SHARED_LIB} SHARED 
    ${GEngine_SOURCES})
add_library(${GEngine_STATIC_LIB} STATIC
    ${GEngine_SOURCES})

add_subdirectory(demos)

install(FILES GEngine_SHARED_LIB DESTINATION lib)
install(FILES GEngine_STATIC_LIB DESTINATION lib)

